<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class TestModel extends CFormModel {

    /**
     *
     * @param type $className
     * @return type 
     */
    public static function model($className=__CLASS__) {
        return parent::model($className);
    }

    public function rules() {
        return array(
        );
    }

    public function getdata() {
        $qtxt = "SELECT * FROM  tbl_user ORDER BY id ASC";
        $command = Yii::app()->db->createCommand($qtxt);
        //	$command->bindValue(":username", '%'.$_GET['term'].'%', PDO::PARAM_STR);
        $rows = $command->queryAll();
        return $rows;
    }

    /**
     * @return string the associated database table name
     */
    public function tableName() {
        return 'tbl_test';
    }

    /**
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels() {
        return array(
            'id' => 'ID',
            'name' => 'Name',
            'note' => 'Note',
        );
    }

}

?>
